//二进制文件的读取
#pragma warning(disable:4996)
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define SIZE 6
int main()
{
	double arr[SIZE] = { 2.14,2.35,3.14,5.200 };
	FILE* pf = fopen("text.bin", "wb");
	if (!pf){
		perror("pf");
		return -1;
	}
	fwrite(arr, sizeof(double), SIZE, pf);
	fclose(pf);

	double arr_code[SIZE] = { 0.0 };
	FILE* pf_code = fopen("text.bin", "rb");
	if (!pf_code) {
		perror("pf_code");
		return -2;
	}
	fread(arr_code, sizeof(double), SIZE, pf_code);
	for (int i = 0; i < SIZE; i++){
		printf("arr_code[%d]:%lf", i, arr_code[i]);
		printf("\n");
	}
	fclose(pf_code);
	return 0;
}